<?php

/**
 * Base model
 *
 * @package
 */
abstract class BaseModel extends Object
{
	/**#@+ Database table constants */
	const TABLE_MENU = 'menu';
	const TABLE_MODULES = 'modules';
	const TABLE_USERS = "users";
	const TABLE_OPTIONS = "options";
	const TABLE_LANGUAGES = "languages";
	/**#@-*/
	
	public $session;
	public $session_web;
	public $translation;
	
	/**
	 * Prevent users to clone the instance
	 */
	final public function __clone()
	{
		throw new Exception('Clone is not allowed');
	}

	/**
	 * Prevent users to unserialize the instance
	 */
	final public function __wakeup()
	{
		throw new Exception('Unserialization is not allowed');
	}

	/**
	 * Instance initialization
	 * @param string $table
	 */
	protected function _init()
	{
		$this->session = Environment::getSession()->getNamespace("system");
		$this->session_web = Environment::getSession()->getNamespace("web");
		$this->translation = Translation::getInstance()->getStaticTranslation();
	}

}
